#include <iostream>
void swapr(int & a, int & b);
int refcube(const int & num);

int main_swaper()
{
    using namespace std;
    int a = 3, b = 5;
    swapr(a, b);
    cout << "交换后的a = " << a
         << " b =" << b << endl;

    int num = 10;
    cout << "refcube of :" << num << " "
         << "is : " << refcube(10) << endl;
    return 0;
}

void swapr(int & a, int & b) {
    int temp;
    temp = a;
    a = b;
    b = temp;
}
// 如果 const 那么refcube(10)这样的表达是编译不通过的，因为这个会创建临时变量
int refcube(const int & num) {
    int result = num * num * num;
    return result;
}
